<template>
  <!-- 课程卡片 组件 -->
  <div class="course_box">
    <!-- 课程标题 -->
    <div class="course_title_box">
      <!-- if 有图片 -->
      <div class="course_img" v-if="imgIsUll">
        <img src="@/assets/imge/defeat_img.png" alt="t" />
      </div>
      <div class="course_title">
        <span class="course_title_start">第一期</span>
        2022年一级消防工程师OMO畅学班
      </div>
    </div>
    <!-- 课程标签 -->
    <div class="course_tag">
      <span v-for="item in [1, 2, 3]" :key="item">标签{{ item }}</span>
    </div>
    <!-- 课程价格及链接 -->
    <div class="course_price">
      <div class="price">$6600-9900</div>
      <div class="link">
        立即查看
        <svg class="you_icon" aria-hidden="true">
          <use xlink:href="#icon-you"></use>
        </svg>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    imgIsUll: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="less" scoped>
.you_icon {
  width: 1.2rem;
  height: 1.2rem;
  vertical-align: -0.15em;
  fill: currentColor;
  margin-left: 0.3rem;
}
.course_box {
  width: 100%;
  //   height: 9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 0.3rem;
  box-sizing: border-box;
  background-color: #fff;
  //   border: 1px solid red;
  .course_title_box {
    display: flex;
    .course_img {
      width: 8rem;
      height: 4rem;
      border-radius: 0.3rem;
      overflow: hidden;
      box-sizing: border-box;
      border: 1px solid #e9e9e9;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .course_title {
      padding: 0 0.5rem;
      box-sizing: border-box;
      font-size: 1.01rem;
      font-weight: 500;
      color: #2a2929;
      .course_title_start {
        color: red;
        font-weight: 600;
        padding: 0.06rem 0.4rem;
        font-size: 0.8rem;
        background: #fa303026;
        border-radius: 0.5rem 0;
        box-sizing: border-box;
      }
    }
  }
  .course_tag {
    display: flex;
    margin: 0.5rem 0;
    line-height: 1.5;
    span {
      background-color: #cccccc26;
      text-align: center;
      font-size: 0.8rem;
      padding: 0.2rem 0.5rem;
      margin-right: 1rem;
      color: #686868;
      border-radius: 0.1rem;
    }
  }
  .course_price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .price {
      font-size: 1.2rem;
      font-weight: bold;
      color: #f40520;
    }
    .link {
      display: flex;
      align-items: center;
      height: 2rem;
      padding: 0rem 1rem;
      border-radius: 2rem;
      font-size: 1rem;
      color: #fff;
      background-image: linear-gradient(to top right, #f69f9f, red);
    }
  }
}
</style>
